
Partial Class Default2
    Inherits System.Web.UI.Page

    Protected Sub lbtnAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lbtnAdd.Click
        Dim BranchID As Integer = Profile.BranchId
        Dim LocationLogic As New GTSSystem.BLL.RateLocation()
        If txtCity.Text.Trim = "" Or txtProv.Text.Trim = "" Or txtCountry.Text.Trim = "" Then
            Message.Text = "Missing required field"
        Else
            Try
                LocationLogic.AddRateLocation(BranchID, txtCity.Text, txtProv.Text, txtCountry.Text)
                Response.Redirect(Request.Url.ToString, False)
                Message.Text = "Location added successfully"
                'Cant always redirect as we need to add location if it does not exits when creating shipment
                'Response.Redirect("~/GTSWeb/Carrier/AddRate.aspx", True)
            Catch ex As Exception
                Message.Text = "Unable to add location"
            End Try
        End If
    End Sub
End Class
